package com.github.thinwonton.spring.web.controller;

import com.github.thinwonton.spring.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
@RequestMapping("/user")
public class UserController extends BaseController {

    @RequestMapping()
    public String showUserForm() {
        return "userForm";
    }

    @RequestMapping("/save")
    @ResponseBody
    public Object saveUser(Date birthday) {
        User user = new User();
        user.setBirthday(birthday);
        return user;
    }

}
